<?php
    // Start of planets table
	TextFlush( "Dropping: {$db_prefix}planets ");
	$res = $db->Execute("DROP TABLE IF EXISTS `{$db_prefix}planets`");
	db_op_result($res,__LINE__,__FILE__);

    TextFlush( "Creating table: {$db_prefix}planets ");
	$res = $db->Execute("CREATE TABLE IF NOT EXISTS `{$db_prefix}planets` (
	`planet_id` int(11) NOT NULL auto_increment,
	`sector_id` int(11) NOT NULL default '0',
	`name` varchar(15) default 'Unknown',
	`owner` int(11) NOT NULL default '0',
	`team` int(11) NOT NULL default '0',
	`base` char(1) NOT NULL default 'N',
	`defeated` char(1) NOT NULL default 'N',
	`fighter` int(11) NOT NULL default '0',
	`fighter_normal` int(11) NOT NULL default '0',
	`fighter_class` varchar(99) default 'Planet_Fighter',
	`sensors` int(11) NOT NULL default '0',
	`sensors_normal` int(11) NOT NULL default '0',
	`beams` int(11) NOT NULL default '0',
	`beams_normal` int(11) NOT NULL default '0',
	`beam_class` varchar(99) default 'Planet_Beam',
	`torp_launchers` int(11) NOT NULL default '0',
	`torp_launchers_normal` int(11) NOT NULL default '0',
	`torp_class` varchar(99) default 'Planet_Torpedo',
	`shields` int(11) NOT NULL default '0',
	`shields_normal` int(11) NOT NULL default '0',
	`shield_class` varchar(99) default 'Planet_Shield',
	`jammer` int(11) NOT NULL default '0',
	`jammer_normal` int(11) NOT NULL default '0',
	`armor` int(11) NOT NULL default '0',
	`armor_normal` int(11) NOT NULL default '0',
	`armor_class` varchar(99) default 'Planet_Armor',
	`cloak` int(11) NOT NULL default '0',
	`cloak_normal` int(11) NOT NULL default '0',
	`sector_defense_weapons` int(11) NOT NULL default '0',
	`sector_defense_weapons_normal` int(11) NOT NULL default '0',
	`sector_defense_sensors` int(11) NOT NULL default '0',
	`sector_defense_sensors_normal` int(11) NOT NULL default '0',
	`sector_defense_cloak` int(11) NOT NULL default '0',
	`sector_defense_cloak_normal` int(11) NOT NULL default '0',
	`team_cash` char(1) NOT NULL default 'Y',
	`colonists` bigint(20) NOT NULL default '0',
	`organics` bigint(20) NOT NULL default '0',
	`organics_planet` double(6,5) NOT NULL default '1.00000',
	`ore` bigint(20) NOT NULL default '0',
	`ore_planet` double(6,5) NOT NULL default '1.00000',
	`goods` bigint(20) NOT NULL default '0',
	`goods_planet` double(6,5) NOT NULL default '1.00000',
	`energy` bigint(20) NOT NULL default '0',
	`energy_planet` double(6,5) NOT NULL default '1.00000',
	`fighters` bigint(20) NOT NULL default '0',
	`torps` bigint(20) NOT NULL default '0',
	`armor_pts` bigint(20) NOT NULL default '1',
	`credits` double(32,0) NOT NULL default '0',
	`max_credits` double(32,0) NOT NULL default '0',
	`special_name` varchar(100) NOT NULL default '',
	`special_amount` double(32,15) NOT NULL default '0',
	`special_goodevil` tinyint(4) NOT NULL default '0',
	`prod_special` tinyint(4) NOT NULL default '0',
	`prod_organics` tinyint(4) NOT NULL default '0',
	`prod_ore` tinyint(4) NOT NULL default '0',
	`prod_goods` tinyint(4) NOT NULL default '0',
	`prod_energy` tinyint(4) NOT NULL default '0',
	`prod_fighters` tinyint(4) NOT NULL default '10',
	`prod_torp` tinyint(4) NOT NULL default '10',
	`prod_research` tinyint(4) NOT NULL default '0',
	`prod_build` tinyint(4) NOT NULL default '0',
	`cargo_hull` int(11) NOT NULL default '0',
	`cargo_power` int(11) NOT NULL default '0',
	`mission_id` int(11) NOT NULL default '0',
	`creation_date` datetime NOT NULL default '0000-00-00 00:00:00',
	`last_visited` datetime NOT NULL default '0000-00-00 00:00:00',
	`creator_id` int(11) NOT NULL default '0',
	`use_age` int(11) NOT NULL default '0',
	`hidden_credits` double(32,0) NOT NULL default '0',
	`captured_countdown` int(11) NOT NULL default '0',
	`persuasion_countdown` int(11) NOT NULL default '0',
	`last_owner_rating` tinyint(4) NOT NULL default '0',
	`personality` tinyint(4) NOT NULL default '0',
	PRIMARY KEY	(`planet_id`),
	KEY `owner` (`owner`),
	KEY `team` (`team`),
	KEY `base` (`base`),
	KEY `sector_id` (`sector_id`),
	KEY `defeated` (`defeated`),
	KEY `credits` (`credits`),
	KEY `max_credits` (`max_credits`),
	KEY `cargo_hull` (`cargo_hull`),
	KEY `cargo_power` (`cargo_power`),
	KEY `prod_fighters` (`prod_fighters`),
	KEY `prod_torp` (`prod_torp`),
	KEY `prod_research` (`prod_research`),
	KEY `prod_build` (`prod_build`),
	KEY `colonists` (`colonists`),
	KEY `last_visited` (`last_visited`)
) TYPE={$database_type}{$dbencoding}");
    db_op2_result("{$db_prefix}planets", $res,__LINE__,__FILE__);
    // End of planets table

?>